import Vuex from 'vuex'
import App from './App'
import Vue from 'vue'
import uView from '@/uni_modules/uview-ui'

Vue.use(uView)
Vue.use(Vuex)

import store from './store'
Vue.prototype.$store=store;



Vue.prototype.$userId = Vue.observable({ value: null });


//拦截权限跳转,如果登陆了就正常跳转，没有登录就让他去登录
Vue.prototype.navigateTo=(options)=>{
	if(!store.state.user.loginStatus){
		uni.showToast({
			title:"请先登录",
			icon:"none"
		})
		return uni.navigateTo({
					url:"pages/login/login"
				})
	}
	
	uni.navigateTo(options)
}



/**/


// #ifndef VUE3

import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif